export type DsPayloadType = 'CreateDsServe' | 'CreateDsFile' | 'UpdateDsFile' | 'UpdateDsServe' | 'OperateDatasource'

export type DsBase = {
    id?: string;
    name: string;
    kind: string;
    lastRefresh: string;
    total?: number;
}

export type DatasourceState = {
    list: DsBase[];
    selected?: DsBase;
    sourceData?: any[];
    descriptions?: DsDescription[];
    loading: boolean;
}

export type DsFile = {
    id?: string;
    name: string;
    dsId?: string;
    kind: string;
    filePath: string;
    query?: string;
}

export type DsServe = {
    id?: string;
    name: string;
    dsId?: string;
    kind: string;
    host: string;
    port: number;
    username: string;
    password?: string;
    schema: string;
    query?: string;
}

export type DsDescription = {
    id?: string;
    dsId: string;
    fieldName: string;
    dataType: string;
    nullable: boolean;
    comment?: string;
    description?: string;
}